Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor grouped queries in CgmesModel #3238

Merged
merged 10 commits into from
Jan 27, 2025

Conversation

rcourtier
Copy link
Member

@rcourtier rcourtier commented Dec 2, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?

No.

What kind of change does this PR introduce?

Refactoring.

What is the current behavior?

There is a lack of consistency in the methods of CgmesModel that fetch data based on a common object ID. The methods don't have a similar naming, nor do they have a similar signature, and nor are they implemented in the same way and in the same class.
For instance:

  • ratioTapChangerTable (table points grouped by table) // groupedTransformerEnds (transformer ends grouped by transformer)
  • PropertyBags ratioTapChangerTable(String tableId) // Map<String, PropertyBags> groupedTransformerEnds()
  • ratioTapChangerListForPowerTransformer (caching is done in Context) // nonlinearShuntCompensatorPoints (caching is done in AbstractCgmesModel)

What is the new behavior (if this is a feature change)?

Interface CgmesModel only provides full queries.
Result from full queries is grouped by common object id and cached in Context.

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Methods removed from CgmesModel:

  • Map<String, PropertyBags> groupedTransformerEnds()
  • List<String> ratioTapChangerListForPowerTransformer(String powerTransformerId)
  • PropertyBags ratioTapChangerTable(String tableId)
  • List<String> phaseTapChangerListForPowerTransformer(String powerTransformerId)
  • PropertyBags phaseTapChangerTable(String tableId)
  • PropertyBags nonlinearShuntCompensatorPoints(String shuntId)

Have been replaced by these methodes in Context:

  • public PropertyBags transformerEnds(String transformerId)
  • public PropertyBags ratioTapChangers(String transformerId)
  • public PropertyBags ratioTapChangerTablePoints(String tableId)
  • public PropertyBags phaseTapChangers(String transformerId)
  • public PropertyBags phaseTapChangerTablePoints(String tableId)
  • public PropertyBags nonlinearShuntCompensatorPoints(String shuntId)

Also, in CgmesModel, the following methods have been renamed for more consistency:

  • ratioTapChangerTablesPoints() into ratioTapChangerTablePoints()
  • phaseTapChangerTablesPoints() into phaseTapChangerTablePoints()

Other information:

Early developments of separation of CGMES import (EQ separately from SSH) show the need for caching result of queries in the Context. This refactoring goes in the same direction.

@rcourtier rcourtier force-pushed the refactor_cgmesmodel_grouped_queries branch from ea68a93 to 860acf3 Compare December 2, 2024 15:22
@rcourtier rcourtier self-assigned this Dec 4, 2024
@rcourtier rcourtier force-pushed the refactor_cgmesmodel_grouped_queries branch from 80d5838 to d7f5aed Compare December 9, 2024 09:21
@rcourtier rcourtier force-pushed the use_endnumber_for_powertransformerend_numbering branch from 4e1fd3d to f680d6a Compare December 9, 2024 09:23
@rcourtier rcourtier force-pushed the refactor_cgmesmodel_grouped_queries branch from d7f5aed to b4c9a64 Compare December 9, 2024 09:24
@rcourtier rcourtier added the Breaking Change API is broken label Dec 9, 2024
@rcourtier rcourtier force-pushed the refactor_cgmesmodel_grouped_queries branch from 8561bd6 to 21a3627 Compare January 7, 2025 08:45
@rcourtier rcourtier force-pushed the use_endnumber_for_powertransformerend_numbering branch from f680d6a to f6b0c3e Compare January 7, 2025 09:33
@rcourtier rcourtier force-pushed the refactor_cgmesmodel_grouped_queries branch from 21a3627 to 12aa957 Compare January 7, 2025 11:03
@rcourtier rcourtier marked this pull request as ready for review January 7, 2025 13:45
@rcourtier rcourtier requested a review from flo-dup January 7, 2025 13:54
Base automatically changed from use_endnumber_for_powertransformerend_numbering to main January 10, 2025 14:15
@rcourtier rcourtier force-pushed the refactor_cgmesmodel_grouped_queries branch from 1f1cb2f to 9f2f88f Compare January 10, 2025 15:32
Signed-off-by: Romain Courtier <[email protected]>
@olperr1 olperr1 merged commit fb3795e into main Jan 27, 2025
8 checks passed
@olperr1 olperr1 deleted the refactor_cgmesmodel_grouped_queries branch January 27, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants